import {HomeProps} from "@/containers/Home/type.ts";

type CategoryProps = {
    categories: HomeProps['categories']
}

function Category(props: CategoryProps) {
    const {categories} = props
    return <div className="category">
        {categories?.length > 0 ?
            categories?.map((item) => (
                <div className="category-item" key={item.id}>
                    <img src={item.imgUrl} className="category-item-img" alt={item.name}/>
                    <div className="category-item-desc">{item.name}</div>
                </div>
            )) : ''
        }
    </div>
}

export default Category

